.class public Lcom/netease/netstat/exception/ExceptionService;
.super Ljava/lang/Object;
.source "ExceptionService.java"


# instance fields
.field private exception:Ljava/lang/Exception;

.field private name:Ljava/lang/String;

.field public obj:Lorg/json/JSONObject;


# direct methods
.method public constructor <init>(Ljava/lang/Exception;Ljava/lang/String;)V
    .locals 1
    .parameter "exception"
    .parameter "name"

    .prologue
    .line 28
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 25
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    iput-object v0, p0, Lcom/netease/netstat/exception/ExceptionService;->obj:Lorg/json/JSONObject;

    .line 29
    iput-object p1, p0, Lcom/netease/netstat/exception/ExceptionService;->exception:Ljava/lang/Exception;

    .line 30
    iput-object p2, p0, Lcom/netease/netstat/exception/ExceptionService;->name:Ljava/lang/String;

    .line 31
    return-void
.end method


# virtual methods
.method public getString()V
    .locals 9

    .prologue
    .line 37
    new-instance v4, Ljava/io/StringWriter;

    invoke-direct {v4}, Ljava/io/StringWriter;-><init>()V

    .line 38
    .local v4, sw:Ljava/io/StringWriter;
    new-instance v2, Ljava/io/PrintWriter;

    invoke-direct {v2, v4}, Ljava/io/PrintWriter;-><init>(Ljava/io/Writer;)V

    .line 40
    .local v2, pw:Ljava/io/PrintWriter;
    iget-object v5, p0, Lcom/netease/netstat/exception/ExceptionService;->exception:Ljava/lang/Exception;

    invoke-virtual {v5, v2}, Ljava/lang/Exception;->printStackTrace(Ljava/io/PrintWriter;)V

    .line 42
    invoke-virtual {v4}, Ljava/io/StringWriter;->toString()Ljava/lang/String;

    move-result-object v5

    const/4 v6, 0x0

    invoke-virtual {v4}, Ljava/io/StringWriter;->toString()Ljava/lang/String;

    move-result-object v7

    const-string v8, "\n"

    invoke-virtual {v7, v8}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v7

    invoke-virtual {v5, v6, v7}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    .line 45
    .local v0, cause:Ljava/lang/String;
    new-instance v3, Ljava/text/SimpleDateFormat;

    .line 46
    const-string v5, "yyyy-MM-dd   HH:mm:ss"

    .line 45
    invoke-direct {v3, v5}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V

    .line 47
    .local v3, sDateFormat:Ljava/text/SimpleDateFormat;
    new-instance v5, Ljava/util/Date;

    invoke-direct {v5}, Ljava/util/Date;-><init>()V

    invoke-virtual {v3, v5}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

    move-result-object v1

    .line 50
    .local v1, date:Ljava/lang/String;
    invoke-virtual {v0}, Ljava/lang/String;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Lcom/netease/netstat/utils/Contanst;->setCause(Ljava/lang/String;)V

    .line 51
    iget-object v5, p0, Lcom/netease/netstat/exception/ExceptionService;->name:Ljava/lang/String;

    invoke-static {v5}, Lcom/netease/netstat/utils/Contanst;->setCname(Ljava/lang/String;)V

    .line 52
    invoke-static {v1}, Lcom/netease/netstat/utils/Contanst;->setTime(Ljava/lang/String;)V

    .line 53
    return-void
.end method

.method public startService()V
    .locals 2

    .prologue
    .line 59
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/netease/netstat/exception/ExceptionService$1;

    invoke-direct {v1, p0}, Lcom/netease/netstat/exception/ExceptionService$1;-><init>(Lcom/netease/netstat/exception/ExceptionService;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 70
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 71
    return-void
.end method
